package com.coderyeah.cosmetology.controller;


import com.coderyeah.cosmetology.entity.Image;
import com.coderyeah.cosmetology.service.ImageService;
import com.coderyeah.cosmetology.util.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author lqs
 * @since 2022-05-24
 */
@RestController
@RequestMapping("/image")
public class ImageController {
    @Resource
    private ImageService imageService;

    @GetMapping("/queryAllByType")
    public Result queryAllByType(@RequestParam("type") String type) {
        return imageService.queryAllByType(type);
    }

    @GetMapping("list")
    public List<Image> getAll() {
        return imageService.list();
    }

    @GetMapping("queryById")
    public Result queryById(@RequestParam("id") Integer id) {
        return imageService.queryById(id);
    }
}

